<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>  {block name="title"}管理系统大布局 - Layui{/block}</title>
    <link rel="stylesheet" href="__LAYUI__/css/layui.css">
    {block name="css"}{/block}
</head>
<body>
<!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
<!--[if lt IE 9]>
<script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
<script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<div class="layui-layout layui-layout-admin">
    <!--    head-->
    {include file="base/head"}
    <!--    head-->
    <!--left- menu-->
    {include file="base/left"}
    <!--left- menu-->
    <div class="layui-body">
        <!-- 内容主体区域 -->
        <div style="padding: 15px;">
            <span class="layui-breadcrumb">
              <a href="">首页</a>
              <a href="{:url(request()->action())}" id="act"></a>
              <a><cite>列表</cite></a>
            </span>
            {block name="content"}{/block}
        </div>
    </div>

<!--    <div class="layui-footer">-->
<!--        &lt;!&ndash; 底部固定区域 &ndash;&gt;-->
<!--        {block name="foot"} 底部固定区域{/block}-->
<!--    </div>-->
</div>
<a href="/{:app('http')->getName()}/{:request()->controller()}/{:request()->action()}.html" style="display: none" id="local"></a>
<script src="__LAYUI__/layui.js"></script>
{block name="js"}{/block}
<script>
    //JS
    layui.use(['element', 'layer', 'util'], function(){
        var element = layui.element
            ,layer = layui.layer
            ,util = layui.util
            ,$ = layui.$;

        //头部事件
        util.event('lay-header-event', {
            //左侧菜单事件
            menuLeft: function(othis){
                layer.msg('展开左侧菜单的操作', {icon: 0});
            }
            ,menuRight: function(){
                layer.open({
                    type: 1
                    ,content: '<div style="padding: 15px;">处理右侧面板的操作</div>'
                    ,area: ['260px', '100%']
                    ,offset: 'rt' //右上角
                    ,anim: 5
                    ,shadeClose: true
                });
            }
        });

        // 解决左侧菜单选中问题
        $(document).ready(function($){
            var local = $('#local').attr('href').toLowerCase();
            //console.log(local);
            $('.layui-nav-child a').each(function(){
                var href = $(this).attr('href');
                var hrefs = href.replace('_','');
                //console.log(hrefs);
                if(local == hrefs){
                    $(this).parent().addClass('layui-this');//layui-nav-itemed
                    console.log($(".layui-this").text())
                    console.log($(".layui-this").html())

                    var menu = $(".layui-this").html()
                    $("#act").html(menu)
                    $(this).parent().parent().parent().addClass('layui-nav-itemed');//
                }
            });
        });
    });
</script>
</body>
</html>